<?php
 /* 
  * @function birthmothers.php
  * @author   Aaron Johnson
  * @created  Dec 1, 2007
  */
 
class Birthmothers extends Controller {

	function Birthmothers()
	{
		parent::Controller();	
	}

	//Array Template:
//		$data['pagetitle'] = '';
//		$data['tblone_title'] = '';
//		$data['tblone_form'] = '';
//		$data['tbltwo_title'] = '';
//		$data['tbltwo_form'] = '';
//		$data['bm_name'] = '';
//		$data['bm_status'] = '';
//		$data['details'] = '';
	
	
	function index()
	{
		$this->load->view('bm/birthmother_view');		
	}

	function register()
	{
		$data['pagetitle'] = 'Birthmother Registration';
		$data['form_action'] = 'birthmothers/register';
		$data['tblone_title'] = 'Contact';
		
		$firstName = array(
			'name'	=>	'firstname',
			'id'	=> 	'firstname',
			'size'	=>  '6',
			'maxlength' => '30'
		);

		$middleName = array(
			'name'	=>	'middlename',
			'id'	=> 	'middlename',
			'size'	=>  '6',
			'maxlength' => '30'
		);
		
		$lastName = array(
			'name' 	=> 	'lastname',
			'id'	=>	'lastname',
			'size'	=>	'15',
			'maxlength' =>'40'
		);
		
		$street = array(
			'name' 	=> 	'street',
			'id'	=>	'street',
			'size'	=>	'15',
			'maxlength' =>'40'
		);
		
		$apt = array(
			'name' 	=> 	'apt_nr',
			'id'	=>	'apt_nr',
			'size'	=>	'3',
			'maxlength' =>'5'
		);
		
		$city = array(
			'name' 	=> 	'city',
			'id'	=>	'city',
			'size'	=>	'6',
			'maxlength' =>'30'
		);
		
		$zip = array(
			'name' 	=> 	'zip',
			'id'	=>	'zip',
			'size'	=>	'5',
			'maxlength' =>'9'
		);
		
		$phone = array(
			'name' 	=> 	'phone',
			'id'	=>	'phone',
			'size'	=>	'10',
			'maxlength' =>'10',
			'value' => 'no symbols'
		);
		
		$email = array(
			'name' 	=> 	'email',
			'id'	=>	'email',
			'size'	=>	'30',
			'maxlength' =>'100',
			'value' => '@'
		);
		
		
//		$tOne['Name']=>'<div style="form_input">'.
//						'First '.form_input($firstName).
//						'$nbsp;Middle '.form_input($middleName).
//						'<br />Last '.form_input($lastName).
//						'</div>';
		
//		$data['tblone_form'] = $tOne['Name'];
		$data['tblone_form'] = '<div class="form">'.
						'<div class="title">Name</div>'.
						'<div class="input">'.
						'First '.form_input($firstName).
						' Middle '.form_input($middleName).
						'<br />Last '.form_input($lastName).
						'</div></div>'.
						'<div class="form">'.
						'<div class="title">Contact</div>'.
						'<div class="input">'.
						'Street '.form_input($street).
						' Apt# '.form_input($apt).
						'<br />City '.form_input($city).
						' State <select name="state"><option value="UT" class="option">Utah</option></select>'.
						'<br />Zip '.form_input($zip).
						'<p>Phone '.form_input($phone).
						' Discreet '.form_checkbox('discreet', 'discreet', false).
						' Message OK '.form_checkbox('message', 'message', false).
						'<br />Email '.form_input($email).
						'</div>'.
						'</div>';
		
		$data['tbltwo_title'] = 'Other';

		$due = array(
			'name' 	=> 	'duedate',
			'id'	=>	'duedate',
			'size'	=>	'10',
			'maxlength' =>'10'
		);
				
		$ethmom = array(
			'name' 	=> 	'bm_ethnic',
			'id'	=>	'bm_ethnic',
			'size'	=>	'8',
			'maxlength' =>'20',
			'value' =>'mother'
		);
		
		$ethdad = array(
			'name' 	=> 	'bf_ethnic',
			'id'	=>	'bf_ethnic',
			'size'	=>	'8',
			'maxlength' =>'20',
			'value' =>'father'
		);
		
		$birthdate = array(
			'name' 	=> 	'birthdate',
			'id'	=>	'birthdate',
			'size'	=>	'10',
			'maxlength' =>'10',
			'value' =>'mm/dd/yyyy'
		);
		
		$options = array(
                  ''  => 'Marital Status',
                  'single'    => 'Single',
                  'married'   => 'Married',
                  'divorced'  => 'Divorced',
				  'separated' => 'Separated'
        );
                
		$insurance = array(
			'name' 	=> 	'insurance',
			'id'	=>	'insurance',
			'size'	=>	'10',
			'maxlength' =>'20'
		);
		
		$otherkids = array(
			'name' 	=> 	'otherkids',
			'id'	=>	'otherkids',
			'size'	=>	'10',
			'maxlength' =>'40'
		);
		
		$data['tbltwo_form'] = '<div class="form">'.
						'<div class="title">Baby</div>'.
						'<div class="input">'.
						'Due Date '.form_input($due).
						'<br />Gender '.
						form_radio('gender','unknown',true).'Unknown '.
						form_radio('gender','male',false).' M '.form_radio('gender','female',false).' F '.
						'<br />Ethnicity '.form_input($ethmom).' '.form_input($ethdad).
						'</div></div>'.
						'<div class="form">'.
						'<div class="title">Miscellaneous</div>'.
						'<div class="input">'.
						'Birthdate '.form_input($birthdate).' '.
						form_dropdown('marital',$options,'').
						'<br />Insurance '.form_input($insurance).' Other Kids '.form_input($otherkids).
						'</div>'.
						'</div>';
		
		$data['bm_name'] = '-- none --';
		$data['bm_status'] = 'New Registration';
		$data['details'] = '-- none --';
	
		$this->load->view('bm/birthmother_view', $data);		
	}
	
	function medical()
	{
		$this->load->view('bm/medical_view');		
	}
	
	function forms()
	{
		$this->load->view('bm/forms_view');		
	}
	
	function legal()
	{
		$this->load->view('bm/legal_view');		
	}
	
	function test()
	{
		$this->load->view('bm/register_view');
	}
	
	function notes()
	{
		$this->load->model('bm_model', 'notes_model');
		
		$data['notes'] = $this->notes_model->getNotes(1);
		
		$this->load->view('bm/notes_view', $data);		
	}
	
	function overview()
	{
		$this->load->view('bm/overview_view');		
	}
}
?>
